<%# NOTE: Since this call can be called from outside decidim-meetings, frontend assets are required %>

<%= apply_meetings_pack_tags %>

<div class="content-block__title">
  <h2 class="h2 decorator">
    <%= single_component? ? decidim_escape_translated(model.name) : t("decidim.components.meetings.name") %>
  </h2>
  <div class="label text-lg"><%= meetings_count %></div>
  <% if see_all_path.present? %>
    <%= link_to see_all_path, class: "button button__sm button__text-secondary" do %>
      <span><%= t("decidim.participatory_spaces.highlighted_meetings.see_all") %></span>
      <%= icon "arrow-right-line" %>
    <% end %>
  <% end %>
</div>
<% if show_map? %>
  <div class="meeting-list__block-map">
    <%= cell "decidim/map", collection, metadata_card: "decidim/meetings/meeting_card_metadata" %>
  </div>
<% end %>
<div class="meeting-list__block-list">
  <% if show_calendar? %>
    <div class="meeting-list__block-list-aside">
      <% calendar_months.each do |start_date| %>
        <%= cell "decidim/meetings/meeting_month", collection, start_date: %>
      <% end %>
    </div>
  <% end %>
  <div class="card__list-list">
    <span class="meeting-list__block-list-title"><%= title %></span>
    <% collection.includes(:component).each do |meeting| %>
      <%= cell "decidim/meetings/meeting_l", meeting, title_tag: :h3, **options.slice(:show_space) %>
    <% end %>
  </div>
</div>
